package com.xindacloud.sms.portal.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xindacloud.sms.portal.dao.SmsPricingMapper;
import com.xindacloud.sms.portal.dto.PricingDTO;
import com.xindacloud.sms.portal.entity.SmsPricing;
import com.xindacloud.sms.portal.service.ISmsPricingService;
import com.xindacloud.sms.portal.vo.PricingListVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Slf4j
@Service
@Deprecated
public class SmsPricingServiceImpl extends ServiceImpl<SmsPricingMapper, SmsPricing> implements ISmsPricingService {

    final SmsPricingMapper smsPricingMapper;

    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    public SmsPricingServiceImpl(SmsPricingMapper smsPricingMapper) {
        this.smsPricingMapper = smsPricingMapper;
    }

    @Override
    public IPage<PricingListVO> queryPricingPageBy(PricingDTO pricingDTO) {
        Page<PricingListVO> pricingPage = new Page<>(pricingDTO.getCurrentPage(), pricingDTO.getPageSize());
        //return smsPricingMapper.selectPageVo(pricingPage, pricingDTO);
        return null;
    }

    @Override
    public List<SmsPricing> queryPricingGroupByCountryCodeAndNetworkCode() {
        return lambdaQuery()
                .groupBy(SmsPricing::getCountryCode, SmsPricing::getNetworkCode)
                .list();

    }

    @Override
    public List<PricingListVO> downloadPricing(PricingDTO pricingDTO) {
        //return smsPricingMapper.downloadPricing(pricingDTO);
        return null;
    }
}
